DDHack v1.0
DirectDraw DLL replacement
http://iki.fi/sol/

** USE AT YOUR OWN RISK **

Copyright (C) 2010 Jari Komppa

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

-- - ---- -- --- -- ---


WHAT?
-----

This is a replacement ddraw.dll designed to work better with the host environment.
Meaning, no palette corruption, no switching the whole system to a different
graphics mode, no 256 color mode windows, no need to kill explorer.exe, etc.

Technically, it's a DLL that implements the directdraw interface (directdraw, 
directdraw2, directdrawsurface and directdrawpalette) - or well, the parts of it
that I have implemented so far.

Then it takes what the game wants to display, dumps it into an OpenGL texture and
renders this on screen.

ddhack is still at a very early stage, and may be somewhat unstable. It has
been mainly tested with the 'kilrathi saga' wing commander 1, wing commander 2,
wing commander 3 and wing commander 4 CD. If any other directdraw programs work, 
it's a miracle!

Comments appreciated.

I'll be releasing the sources once I'm somewhat satisfied with it.

Cheers,
   Sol

-- - ---- -- --- -- ---


USAGE
-----

Copy to the application directory (next to the .exe). Play. 
Optionally: edit ddhack.cfg to tweak behavior.

-- - ---- -- --- -- ---


CONFIGURATION
-------------

Edit ddhack.cfg, a plain text file. ddhack recognizes the following configuration options:
(these should be in the file separated by spaces. No newlines, nothing extra, please).

bilinear      - smoothed graphics
halfnhalf     - first upscaled, then bilinear interpolated graphics (wc1/wc2 only)
showlogo      - keep the ddhack logo on screen
subtleoldlcd  - subtle trails on graphics
oldlcd        - trails on graphics
veryoldlcd    - very trippy trails on graphics
wc3scandouble - scan-double deinterlace wc3 videos
wc3blurvideo  - run a box blur filter on video
wc3smallvid   - render videos in smaller resolution surrounded by black borders (-no_interlace only)
altwinpos     - alternate window position; may help if you get a black screen

The logo is on the screen for two seconds after start to show that ddhack is active.


Example config:

-- 8< -- 8< --
halfnhalf showlogo wc3smallvid subtleoldlcd
-- 8< -- 8< --

that should be the only content of ddhack.cfg.

-- - ---- -- --- -- ---


VERSION HISTORY
---------------

1.0 - Public release
    - Half'n'half mode was broken, fixed

0.8 - Tweaked GDI output a bit, resulting in slightly better working savegame naming and
      the "change CD" display to work. Without this, the "change CD" display seems to just have hung.

0.7 - Wing Commander 4 support. Other wing commanders untested, so some things *may* have broken.
      Known issue: briefing screen (green grid, white text) blinks until all text has been "written".
      Only version tested so far is wc4cd, no idea if dvd version does something different.
      8bit and 16bit videos work.

0.6 - wc3 -no_interlace option support, wc3 video blur option, wc3 small video option,
      scan-double should no longer mess up text
      
0.5 - Wing commander 3 support(!), wc3 scan doubling for videos, 
      couple alternate window position settings for troubleshooting.

0.4 - Wing commander 2 fixes, options moved from keyboard to config file

0.3 - Added half'n'half and 'old LCD' modes

0.2 - added delay loading of OpenGL library to run on winxp (and a kludge to make THAT
      work with win7).

0.1 - original release


-- - ---- -- --- -- ---